package com.woniu.apidriver.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.internalcommon.dto.*;
import com.woniu.internalcommon.remote.ServiceDriverUserClient;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    @Resource
    private ServiceDriverUserClient driverUserClient;
    /**
     * 更新司机信息
     * @param driverUser
     * @return
     */
    public ResponseResult updateUser(DriverUser driverUser) {
        return driverUserClient.updateDriverUser(driverUser);
    }

    /**
     * 修改司机工作状态
     * @param driverUserWorkStatus
     * @return
     */
    public ResponseResult changeWorkStatus(DriverUserWorkStatus driverUserWorkStatus) {
        return driverUserClient.changeWorkStatus(driverUserWorkStatus);
    }

    /**
     * 查询司机和车辆绑定关系
     * @param driverPhone
     * @return
     */
    public ResponseResult getDriverCarBindingRelationship(String driverPhone) {
        return driverUserClient.getDriverCarRelationShip(driverPhone);
    }

    /**
     * 查询司机工作状态
     * @param driverId
     * @return
     */
    public ResponseResult<DriverUserWorkStatus> getWorkStatus(Long driverId) {
        return driverUserClient.selecStatustById(driverId);
    }

    public ResponseResult<Page<DriverUser>> getAll(Integer current, Integer size) {
        return driverUserClient.getAll(current,size);
    }

    public ResponseResult<Page<Car>> getAllCar(ApiBossCar apiBossCar) {
        return driverUserClient.getAllCar(apiBossCar);
    }
}
